(deftemplate person (slot gender) (slot age) (slot status))
(deftemplate activity (slot spareTime) (slot hobby))
(deftemplate present (slot budget))

(defrule R1 
	(person (age "k10") (gender "m") (status "single")) 
	=> 
	(printout t "robot;console game;"))
	
(defrule R2 
	(person (age "a1015") (status "single")) 
	=> 
	(printout t "busana;smartphone;handphone;"))
	
(defrule R3 
	(person (age "l20")) 
	=> 
	(printout t "jam tangan;"))

(defrule R4 
	(person (gender "m"))
	(present (budget "l500"))
	=> 
	(printout t "sepeda;alat musik;"))

(defrule R5 
	(person (age "k10") (gender "m") (status "single")) 
	=> 
	(printout t "robot;console game;"))
	
(defrule R6 
	(person (age "k10") (gender "m") (status "single"))
	(activity (spareTime k1))
	=> 
	(printout t "alat olahraga;alas kaki;"))

(defrule R7 
	(present (budget "l500")) 
	=> 
	(printout t "mobil;perhiasan;motor;"))

(defrule R8 
	(activity (hobby "indoor"))
	(present (budget "l500"))
	=> 
	(printout t "handphone;laptop;smartphone;"))
	
(defrule R9 
	(person (age "a1620") (status "single")) 
	=> 
	(printout t "dvd player;dvd;"))
	
(defrule R10 
	(activity (hobby "indoor")) 
	=> 
	(printout t "alat tulis;jam weker;"))

(defrule R11 
	(activity (hobby "outdoor"))
	(person (gender "f"))
	=> 
	(printout t "parfum;"))
	
(defrule R12 
	(person (status "married")) 
	=> 
	(printout t "kitchen set;kamera;"))
	
(defrule R13 
	(person (age "a1015") (gender "f") (status "single"))
	(present (budget "a100500"))
	=> 
	(printout t "parfum;boneka;jam weker;"))
	
(defrule R14 
	(present (budget "a100500"))
	=> 
	(printout t "parfum;sepeda;"))

(defrule R15 
	(activity (spareTime "k1") (hobby "outdoor")) 
	=> 
	(printout t "alas kaki;sepeda;"))
	
(defrule R16 
	(activity (spareTime "a15") (hobby "indoor")) 
	=> 
	(printout t "console game;"))
	
(defrule R17 
	(activity (spareTime "a510")) 
	=> 
	(printout t "sepeda;"))

(defrule R18 
	(activity (spareTime "l10")) 
	=> 
	(printout t "dvd player"))

(defrule R19 
	(person (age "a1620")) 
	=> 
	(printout t "handphone;"))
	
(defrule R20 
	(person (status "single")) 
	=> 
	(printout t "jam tangan;"))
	
;========================================================
(defrule P1
	(person (gender "m") )
	=>
	(printout t "console game;"))
	
(defrule P2
	(person (gender "f") )
	=>
	(printout t "boneka;"))
	
(defrule P3
	(person (age "k10"))
	=>
	(printout t "boneka;buku bacaan;alat tulis;robot;"))
	
(defrule P4
	(person (age "a1015"))
	=>
	(printout t "jam tangan;sepeda;console game;alat musik"))
	
(defrule P5
	(person (age "a1620"))
	=>
	(printout t "alat olahraga;handphone"))
	
(defrule P6
	(person (age "l20"))
	=>
	(printout t "perhiasan;smartphone;busana"))
	
(defrule P7
	(person (status "single"))
	=>
	(printout t "perhiasan;busana;"))
	
(defrule P8
	(person (status "married"))
	=>
	(printout t "kitchen set;dining set;tea set;"))
	
(defrule P9
	(activity (spareTime "k1"))
	=>
	(printout t "handphone;jam tangan;kamera;"))
	
(defrule P10
	(activity (spareTime "a15"))
	=>
	(printout t "alat olahraga;sepeda;"))
	
(defrule P11
	(activity (spareTime "a510"))
	=>
	(printout t "buku bacaan;alat musik;"))
	
(defrule P12
	(activity (spareTime "l10"))
	=>
	(printout t "dvd;dvd player;console game;"))
	
(defrule P13
	(activity (hobby "indoor"))
	=>
	(printout t "console game;buku bacaan;alat musik;dvd;dvd player"))
	
(defrule P10
	(activity (hobby "outdoor"))
	=>
	(printout t "sepeda;"))
	
(defrule P11
	(present (budget "k100"))
	=>
	(printout t "alat tulis;boneka;buku bacaan;dvd;"))
	
(defrule P12
	(present (budget "k100500"))
	=>
	(printout t "busana;alas kaki;kitchen set;dining set;tea set;"))
	
(defrule P13
	(present (budget "l500"))
	=>
	(printout t "handphone;smartphone;laptop;mobil;sepeda motor;"))
	
(defrule P14
	(person (gender "m") (status "single"))
	=>
	(printout t "jam tangan;"))
	
(defrule P15
	(person (gender "m") (status "married"))
	=>
	(printout t "buku bacaan;"))
	
(defrule P16
	(person (gender "f") (status "single"))
	=>
	(printout t "perhiasan;"))
	
(defrule P17
	(person (gender "f") (status "married"))
	=>
	(printout t "kitchen set;"))

(defrule P18
	(person (status "single"))
	(present (budget "k100"))
	=>
	(printout t "buku bacaan;"))
	
(defrule P19
	(person (status "single"))
	(present (budget "a100500"))
	=>
	(printout t "dvd;"))
	
(defrule P20
	(person (status "single"))
	(present (budget "l500"))
	=>
	(printout t "alat musik;"))
	
(defrule P21
	(person (status "married"))
	(present (budget "k100"))
	=>
	(printout t "jam dinding;"))
	
(defrule P22
	(person (status "married"))
	(present (budget "a100500"))
	=>
	(printout t "dining set;"))
	
(defrule P23
	(person (status "married"))
	(present (budget "l500"))
	=>
	(printout t "kamera;"))